/**
 *
 */
package idao;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * An interface used for processing returned result sets at row level.
 * Implementations must have a no arugment constructor.
 * 
 * @author huhao
 */
public interface RowHandler
{

    /**
     * Implementations must implement this method to process one row of data in
     * the ResultSet. This method should not call next() on the ResultSet, only
     * extract data from it. And method close() should be not called either.
     * 
     * @param rs
     *        the ResultSet to process
     * @param rowNum
     *        the number of the current row, start from 1
     * @return the result object
     * @throws SQLException
     *         if a SQLException is encountered
     */
    Object handleRow(ResultSet rs, int rowNum) throws SQLException;
}
